import request from '@/api/request';

/**
 * 分页
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverPageApi = query => {
    return request({
        url: '/api/mgt/server/page',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 启用的列表
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverListEnabledApi = query => {
    return request({
        url: '/api/mgt/server/listEnabled',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 详情
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverDetailApi = query => {
    return request({
        url: '/api/mgt/server/getDetail',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 添加
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverSaveApi = query => {
    return request({
        url: '/api/mgt/server/save',
        method: 'post',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverEditApi = query => {
    return request({
        url: '/api/mgt/server/edit',
        method: 'put',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑状态
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverEditStatusApi = query => {
    return request({
        url: '/api/mgt/server/editStatus',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 删除
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const serverRemoveApi = query => {
    return request({
        url: '/api/mgt/server/removeByIds',
        method: 'delete',
        params: query,
        isLoading: true
    });
};
